///题⽬3：实现⼀个算法，输⼊是⼈数(>=2)，计算任意⼀天同时存在两个及以上的⼈过⽣⽇的概率，保留四位⼩数。(20)
/// consider the leap year, calculate it in 366
const DAYS: u32 = 365;
pub fn new_birthday_probability(n: u32) -> f64 {
    if n >= DAYS {
        return 1.0;
    }
    // 365/366, 364/366.
    let mut inv_prob = 1.0;
    for i in 0..n {
        inv_prob *= (DAYS - i) as f64 / DAYS as f64;
    }
    return 1.0 - inv_prob;
}
